/**
 * Create by CaoWenjian
 *
 * @copyRight: 2018
 **/
package com.bjboot.caocao.system.service;

import com.bjboot.caocao.common.exception.BJException;
import com.bjboot.caocao.system.domain.DeptDO;
import com.bjboot.caocao.system.domain.Tree;
import com.bjboot.caocao.system.domain.UserDO;
import com.bjboot.caocao.system.pojo.UserPwdPojo;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *@Description 用户对应的service
 *@Author 操文健
 *@Date 2018-09-07 上午11:27
 *@Version 1.0
 **/
@Service
public interface UserService {

    /**
     * 根据用户Id查询用户的信息
     * @param userId
     * @return
     */
    UserDO getUserById(Long userId);

    /**
     * 更新用户的信息
     * @param user
     * @return
     */
    boolean updatePersonal(UserDO user);

    /**
     * 修改个人密码
     * @param userPojo
     * @param user
     */
    int resetPwd(UserPwdPojo userPojo, UserDO user) throws BJException;

    /**
     * 管理员重置密码
     * @param userVO
     * @return
     * @throws BJException
     */
    int adminResetPwd(UserPwdPojo userVO) throws BJException;

    /**
     * 根据用户Id查询该用户所有的角色并将其封装在内
     * @param id
     * @return
     */
    UserDO get(Long id);

    /**
     * 更新用户头像信息
     * @param file
     * @param avatar_data
     * @param userId
     * @return
     */
    Map<String,Object> updatePersonalImg(MultipartFile file, String avatar_data, Long userId) throws Exception;



    List<UserDO> list(Map<String, Object> map);

    int count(Map<String, Object> map);

    int save(UserDO user);

    int update(UserDO user);

    int remove(Long userId);

    int batchremove(Long[] userIds);

    boolean exit(Map<String, Object> params);

    //Set<String> listRoles(Long userId);

    Tree<DeptDO> getTree();



}
